package com.cmcc.pp.ui.gatewayadministration;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;

import com.cmcc.pp.R;
import com.cmcc.pp.base.BFragment;
import com.cmcc.pp.ui.MianActivityDrawerLayout;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by ABC on 2017/12/21.
 * 网关管理
 */

public class FragmentGatewayAdministration extends BFragment {


    @Bind(R.id.gateway_edt_input)
    EditText gatewayEdtInput;
    @Bind(R.id.setting_image_close)
    ImageView settingImageClose;
    @Bind(R.id.gateway_but_cheack)
    Button gatewayButCheack;

    @Override
    protected boolean getHasTitle() {
        return true;
    }

    @Override
    public int getContentLayoutId() {
        return R.layout.activity_gatewayadministration;
    }

    @Override
    public void initView(View fragmentView) {
        getHeader().setTitle(R.string.str_gatewaycheack);
        getHeader().showLeftImage(R.mipmap.iocn_menubar);
    }

    @Override
    public void loadData() {

    }

    @OnClick({
            R.id.gateway_but_cheack,
    })
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.gateway_but_cheack:
                openResults();
                break;

        }
    }

    //查询结果
    private void openResults() {
        Intent resultIntent = new Intent(getActivity(), QueryResultsForGateway.class);
        startActivity(resultIntent);
    }

    //打开菜单
    private void openmeunbar() {
        MianActivityDrawerLayout mianActivityDrawerLayout = (MianActivityDrawerLayout) getActivity();
        mianActivityDrawerLayout.closemenu();

    }

    @Override
    protected void onLeftClick() {
        openmeunbar();
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        ButterKnife.bind(this, rootView);
        return rootView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}
